<html>
<head><meta charset="utf-8"><title>Meeting 2021-05-24 · project-portable-simd · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/index.html">project-portable-simd</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html">Meeting 2021-05-24</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="240097721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240097721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240097721">(May 24 2021 at 19:13)</a>:</h4>
<p>If you are meeting tonight, I would like to talk a little about function approximation.</p>



<a name="240099235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240099235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240099235">(May 24 2021 at 19:24)</a>:</h4>
<p>meeting is in an hour and a half, it's on the libs calendar: <a href="https://calendar.google.com/calendar/u/0/embed?src=9kuu8evq4eh6uacm262k0phri8@group.calendar.google.com">https://calendar.google.com/calendar/u/0/embed?src=9kuu8evq4eh6uacm262k0phri8@group.calendar.google.com</a></p>



<a name="240099248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240099248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240099248">(May 24 2021 at 19:24)</a>:</h4>
<p>it's just held in zulip</p>



<a name="240100053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240100053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240100053">(May 24 2021 at 19:30)</a>:</h4>
<p>I can't control that definition or I would make it biweekly like it is supposed to be. ^^;</p>



<a name="240100529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240100529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240100529">(May 24 2021 at 19:33)</a>:</h4>
<p>oh, til</p>



<a name="240100592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240100592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240100592">(May 24 2021 at 19:34)</a>:</h4>
<p>there is one this week tho right?</p>



<a name="240100780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240100780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240100780">(May 24 2021 at 19:35)</a>:</h4>
<p>Yeah.</p>



<a name="240101239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240101239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240101239">(May 24 2021 at 19:39)</a>:</h4>
<p>can't you just ask whoever is part of the libs team to edit for you?</p>



<a name="240101359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240101359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240101359">(May 24 2021 at 19:40)</a>:</h4>
<p>Even better, I can obtain the power.<br>
Fixed.</p>



<a name="240111495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240111495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240111495">(May 24 2021 at 21:02)</a>:</h4>
<p>Hello, there we go.</p>



<a name="240111531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240111531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240111531">(May 24 2021 at 21:02)</a>:</h4>
<p>hi, all</p>



<a name="240111569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240111569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240111569">(May 24 2021 at 21:02)</a>:</h4>
<p>Meeting time, how is everyone today? I have not actually gotten the hackmd up, because I have had a very strange day. <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="240111578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240111578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240111578">(May 24 2021 at 21:03)</a>:</h4>
<p>My first time, so assume I know nothing :)</p>



<a name="240111691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240111691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240111691">(May 24 2021 at 21:03)</a>:</h4>
<p><span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="240112046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240112046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240112046">(May 24 2021 at 21:06)</a>:</h4>
<p>I thought that I should contribute something to the SIMD side of things as it is my sepciality.</p>



<a name="240112081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240112081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240112081">(May 24 2021 at 21:07)</a>:</h4>
<p>or speciality as the case may be.</p>



<a name="240112218"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240112218" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240112218">(May 24 2021 at 21:08)</a>:</h4>
<p>:)</p>



<a name="240112230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240112230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240112230">(May 24 2021 at 21:08)</a>:</h4>
<p>Glad to have you here! ^^<br>
Here we go. <a href="https://hackmd.io/tRDC_oOBRCeZrvK7ZMuXNQ">https://hackmd.io/tRDC_oOBRCeZrvK7ZMuXNQ</a></p>



<a name="240112244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240112244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240112244">(May 24 2021 at 21:08)</a>:</h4>
<blockquote>
<ol start="0">
<li>are we ready to open a PR to land on nightly?</li>
</ol>
</blockquote>
<p>No. Next question.</p>



<a name="240112285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240112285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240112285">(May 24 2021 at 21:08)</a>:</h4>
<blockquote>
<ol>
<li>what did wg-llvm say?</li>
</ol>
</blockquote>
<p><span class="user-mention" data-user-id="229517">@Jacob Lifshay</span> ?</p>



<a name="240112496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240112496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240112496">(May 24 2021 at 21:11)</a>:</h4>
<p>basically no one noticed till an hour or two ago, all they said so far is that they don't want stuff added to the llvm/rust bindings, it should go upstream</p>



<a name="240112750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240112750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240112750">(May 24 2021 at 21:13)</a>:</h4>
<p>Always a challenge to keep patches in forks.</p>



<a name="240112777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240112777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240112777">(May 24 2021 at 21:13)</a>:</h4>
<p>though <span class="user-mention" data-user-id="312331">@Caleb Zulawski</span> did mention he tested inlining lib calls and that works</p>



<a name="240112888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240112888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240112888">(May 24 2021 at 21:13)</a>:</h4>
<p>alright, wg-llvm says it is less maintainable to put that in our fork.</p>



<a name="240113079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113079">(May 24 2021 at 21:15)</a>:</h4>
<p>I am working on 8. The trig functions. I have two very good candidates.</p>



<a name="240113084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113084">(May 24 2021 at 21:15)</a>:</h4>
<blockquote>
<ol start="3">
<li>we need to draft the RFC?</li>
</ol>
</blockquote>
<p>I have been collecting draft notes <a href="https://hackmd.io/u-XfyDs7QDm4H4zjFFXgAg">here</a> they should probably go in the project group repo and we should probably start using that more.</p>



<a name="240113130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113130">(May 24 2021 at 21:15)</a>:</h4>
<blockquote>
<ol start="4">
<li>schedule vector-of-pointers for review someday, somewhere <span aria-label="rainbow" class="emoji emoji-1f308" role="img" title="rainbow">:rainbow:</span> </li>
</ol>
</blockquote>
<p>I think we can handle this async, unless there's objections?</p>



<a name="240113151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113151">(May 24 2021 at 21:16)</a>:</h4>
<p>so, I guess the next step is wait to see if anyone else in wg-llvm has stuff to say, otherwise start a thread on llvm's mailing list?</p>



<a name="240113222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113222">(May 24 2021 at 21:16)</a>:</h4>
<p>Yeah I guess that isn't really a resolution. Hm.</p>



<a name="240113227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113227">(May 24 2021 at 21:16)</a>:</h4>
<ol start="4">
<li>async sounds good!</li>
</ol>



<a name="240113244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113244">(May 24 2021 at 21:16)</a>:</h4>
<p>Yeah, next steps are asking upstream (LLVM) how it feels about this.</p>



<a name="240113295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113295">(May 24 2021 at 21:17)</a>:</h4>
<p>What changes are you planning to push to upstream LLVM?</p>



<a name="240113322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113322">(May 24 2021 at 21:17)</a>:</h4>
<p>do you want to followup on their mailing list, Jacob? I assume <code>llvm-devel</code>?</p>



<a name="240113405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113405">(May 24 2021 at 21:18)</a>:</h4>
<p>sure!</p>



<a name="240113603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113603">(May 24 2021 at 21:20)</a>:</h4>
<p><span class="user-mention silent" data-user-id="412320">Andy Thomson</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Meeting.202021-05-24/near/240113295">said</a>:</p>
<blockquote>
<p>What changes are you planning to push to upstream LLVM?</p>
</blockquote>
<p>We would like to extend the ability of LLVM to be able to handle more complex libcall legalizations for SIMD in the form of a more expansive <code>libmvec</code>.</p>



<a name="240113692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113692">(May 24 2021 at 21:21)</a>:</h4>
<p>the stuff we wanted to upstream is the code llvm uses to convert its builtin functions to calls to a vector math library -- adding rust's vector math library to the list of libraries it supports</p>



<a name="240113742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113742">(May 24 2021 at 21:21)</a>:</h4>
<p>It is essential to inline libm functions or most of the benefits will be lost.</p>



<a name="240113743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113743">(May 24 2021 at 21:21)</a>:</h4>
<p>explained somewhat here: <a href="https://github.com/rust-lang/stdsimd/issues/109">https://github.com/rust-lang/stdsimd/issues/109</a></p>



<a name="240113843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113843">(May 24 2021 at 21:22)</a>:</h4>
<p>yup, llvm will inline them, that's what <span class="user-mention" data-user-id="312331">@Caleb Zulawski</span> tested as mentioned earlier</p>



<a name="240113927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113927">(May 24 2021 at 21:23)</a>:</h4>
<p>Short functions are easy to inline. The IA64 ABI is a poor choice for SIMD calls.</p>



<a name="240113948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240113948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240113948">(May 24 2021 at 21:23)</a>:</h4>
<p>IA-64 what</p>



<a name="240114046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114046">(May 24 2021 at 21:24)</a>:</h4>
<p>don't you mean the x86-64 GNU/Linux ABI?</p>



<a name="240114050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114050">(May 24 2021 at 21:24)</a>:</h4>
<p>LLVM uses the IA64 ABI (originally the Itanium) in most cases. It has a calling convention for SIMD.</p>



<a name="240114141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114141">(May 24 2021 at 21:25)</a>:</h4>
<p>actually correctly called x86_64 SystemV ABI</p>



<a name="240114303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114303">(May 24 2021 at 21:27)</a>:</h4>
<p>well, I don't think anyone's running Rust code on the Itanic, we're mostly concerned about the AMD64 System V ABI and the MSVC ABI. ^^;</p>



<a name="240114346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114346">(May 24 2021 at 21:27)</a>:</h4>
<p>iirc the Itanium ABI has to do with the C++ name mangling scheme, not as much the SIMD argument passing protocol</p>



<a name="240114353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114353">(May 24 2021 at 21:27)</a>:</h4>
<p>The ABI derived from the Itanium, but is now the convention for x86_64.</p>



<a name="240114373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114373">(May 24 2021 at 21:27)</a>:</h4>
<p>That was a <em>long</em> time ago.</p>



<a name="240114428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114428">(May 24 2021 at 21:28)</a>:</h4>
<p>There is in fact a separately-specified AMD64 standard.</p>



<a name="240114490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114490">(May 24 2021 at 21:28)</a>:</h4>
<p>well, in any case, we expect stuff to be inlined. Rustc doesn't currently even support passing SIMD values except through memory</p>



<a name="240114498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114498">(May 24 2021 at 21:29)</a>:</h4>
<p>I'll check my compiler history. No worries. Just avoid passing SIMD registers over function boundaries.</p>



<a name="240114647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114647">(May 24 2021 at 21:30)</a>:</h4>
<p><span class="user-mention silent" data-user-id="412320">Andy Thomson</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Meeting.202021-05-24/near/240114498">said</a>:</p>
<blockquote>
<p>I'll check my compiler history. No worries. Just avoid passing SIMD registers over function boundaries.</p>
</blockquote>
<p>Rust exerts its own influence over the calling convention that Rust functions are called with, this is currently the source of some pessimizations, it may in the future be the source of some optimizations, passing data over function boundaries this way is not a concern per se.</p>



<a name="240114656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114656">(May 24 2021 at 21:30)</a>:</h4>
<p>rustc chose that precisely because of the ABI issues with enabling AVX changing how types are passed (and other related problems)</p>



<a name="240114752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114752">(May 24 2021 at 21:31)</a>:</h4>
<p>also, I'd expect that llvm is perfectly capable of calling lib functions with a different declared ABI than C</p>



<a name="240114793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114793">(May 24 2021 at 21:31)</a>:</h4>
<p>so I assure you, we are aware of what we are doing, and are aware that it is quite complicated. ^^;</p>



<a name="240114808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114808">(May 24 2021 at 21:32)</a>:</h4>
<p>if not, adding that support shouldn't be too hard</p>



<a name="240114813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114813">(May 24 2021 at 21:32)</a>:</h4>
<p>It has a wide set of ABIs to use.</p>



<a name="240114891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114891">(May 24 2021 at 21:32)</a>:</h4>
<p>We did a lot of work on this at Sony.</p>



<a name="240114906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114906">(May 24 2021 at 21:32)</a>:</h4>
<p>for a different project, I was using the tailcc ABI just recently</p>



<a name="240114995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240114995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240114995">(May 24 2021 at 21:33)</a>:</h4>
<p>Cool</p>



<a name="240115430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115430">(May 24 2021 at 21:36)</a>:</h4>
<p>cranelift is the next item?</p>



<a name="240115466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115466">(May 24 2021 at 21:37)</a>:</h4>
<p>Can you tell me a bit about this?</p>



<a name="240115520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115520">(May 24 2021 at 21:37)</a>:</h4>
<p>The current situation, <span class="user-mention" data-user-id="412320">@Andy Thomson</span>, is that for some libcall legalized items, the data of a vector is torn apart and <strong>individually passed, as scalar calls, for each item</strong>.</p>



<a name="240115621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115621">(May 24 2021 at 21:38)</a>:</h4>
<p>The System V AMD64 ABI permits the use of an actual SIMD register in a function call.</p>



<a name="240115636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115636">(May 24 2021 at 21:38)</a>:</h4>
<p>As does, to some extent, the MSVC ABI, the other one we care about a lot.</p>



<a name="240115673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115673">(May 24 2021 at 21:38)</a>:</h4>
<p>(for x86_64 at least)</p>



<a name="240115679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115679">(May 24 2021 at 21:38)</a>:</h4>
<p>Ouch! That is not ideal. Worse than memory.</p>



<a name="240115686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115686">(May 24 2021 at 21:38)</a>:</h4>
<p>indeed.</p>



<a name="240115704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115704">(May 24 2021 at 21:38)</a>:</h4>
<p>There is absolutely no way that, even without inlining, that our plans cannot improve on that.</p>



<a name="240115769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115769">(May 24 2021 at 21:39)</a>:</h4>
<p>plus, writing a vector-math library means we can use sin in core!</p>



<a name="240115778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115778">(May 24 2021 at 21:39)</a>:</h4>
<p>anyways!</p>



<a name="240115894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115894">(May 24 2021 at 21:40)</a>:</h4>
<p>Cranelift:<br>
Cranelift is an alternate backend to LLVM.</p>



<a name="240115937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115937">(May 24 2021 at 21:41)</a>:</h4>
<p>than llvm. cranelift is not part of llvm</p>



<a name="240115938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115938">(May 24 2021 at 21:41)</a>:</h4>
<p>I've just been reading.</p>



<a name="240115950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115950">(May 24 2021 at 21:41)</a>:</h4>
<p>alternate to LLVM from Rust's perspective? ^^;</p>



<a name="240115960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115960">(May 24 2021 at 21:41)</a>:</h4>
<p>:)</p>



<a name="240115986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240115986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240115986">(May 24 2021 at 21:41)</a>:</h4>
<p>It is faster at generating code because it is primarily designed as a JIT backend and it does not do many of the things that LLVM does, starting with "caring about things like types that are not raw bitwidths".</p>



<a name="240116096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116096">(May 24 2021 at 21:42)</a>:</h4>
<p>If you avoid all the Dwarf generation, you can save a lot of compile time.</p>



<a name="240116159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116159">(May 24 2021 at 21:43)</a>:</h4>
<p>also, cranelift is more optimized for speed of compiling, whereas llvm is very much optimized for speed of resulting code at the expense of compile-time</p>



<a name="240116173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116173">(May 24 2021 at 21:43)</a>:</h4>
<p>Cranelift still can and does emit DWARF, it's primarily meant for faster debug builds in the Rust context. The thing that is really saving time is that Cranelift does as much as possible in-place.</p>



<a name="240116223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116223">(May 24 2021 at 21:44)</a>:</h4>
<p>I always had beef with  LLVM's steadfast single threadedness.</p>



<a name="240116285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116285">(May 24 2021 at 21:44)</a>:</h4>
<p>llvm is built on linked-lists &amp; graphs which are known to be awful for cache performance</p>



<a name="240116304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116304">(May 24 2021 at 21:44)</a>:</h4>
<p>Very rapid streaming lowering, not as many transformations that alter _size_ of the data, so it doesn't have to move those around. Just one big array of instructions, more or less.</p>



<a name="240116415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116415">(May 24 2021 at 21:45)</a>:</h4>
<p>anyways we haven't really been testing this so we don't know how broken the lib is on Cranelift. Slight problem if we're going to share space on nightly with Cranelift.</p>



<a name="240116431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116431">(May 24 2021 at 21:45)</a>:</h4>
<p>LLVM's many IRs is a big source of makework and lack of good codegen.</p>



<a name="240116511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116511">(May 24 2021 at 21:46)</a>:</h4>
<p>at least 5 for the average debug build?</p>



<a name="240116611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116611">(May 24 2021 at 21:47)</a>:</h4>
<p>I think someone just needs to sit down and harass bjorn3 a lot.<br>
I've already poked around at Cranelift so maybe I should do it? ^^;</p>



<a name="240116648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116648">(May 24 2021 at 21:47)</a>:</h4>
<p><a href="https://llvm.org/devmtg/2014-04/PDFs/Talks/Tenseconds.pdf">https://llvm.org/devmtg/2014-04/PDFs/Talks/Tenseconds.pdf</a></p>



<a name="240116668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116668">(May 24 2021 at 21:47)</a>:</h4>
<p>llvm ir -&gt; selection dag -&gt; mir -&gt; assembly -&gt; machine code?</p>



<a name="240116716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116716">(May 24 2021 at 21:47)</a>:</h4>
<p>likewise someone needs to add the stability attributes.</p>



<a name="240116891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116891">(May 24 2021 at 21:49)</a>:</h4>
<p>Very interesting to see. I have some reading to do.</p>



<a name="240116894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116894">(May 24 2021 at 21:49)</a>:</h4>
<p>Ugh actually I am going to itemize the cranelift review and put up a request, I should probably get on top of the stability attributes adding and such since I've done more of that and it will be less overhead.</p>



<a name="240116916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116916">(May 24 2021 at 21:49)</a>:</h4>
<p>Here's <a href="https://github.com/bytecodealliance/wasmtime/tree/main/cranelift">https://github.com/bytecodealliance/wasmtime/tree/main/cranelift</a></p>



<a name="240116991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240116991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240116991">(May 24 2021 at 21:50)</a>:</h4>
<p>and <code>cg_clif</code> support for SIMD is tracked here: <a href="https://github.com/bjorn3/rustc_codegen_cranelift/issues/171">https://github.com/bjorn3/rustc_codegen_cranelift/issues/171</a></p>



<a name="240117037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117037">(May 24 2021 at 21:50)</a>:</h4>
<p>do note that cranelift is currently transitioning from their old x86 backend to their new backend</p>



<a name="240117038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117038">(May 24 2021 at 21:50)</a>:</h4>
<p>Did you resolve the LLVM interpretation of min and max. It currently uses a two-instruction sequence?</p>



<a name="240117093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117093">(May 24 2021 at 21:51)</a>:</h4>
<p>well, what can I say? NaN correctness!</p>



<a name="240117123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117123">(May 24 2021 at 21:51)</a>:</h4>
<p>Nan correctness should be anything + NaN = NaN!</p>



<a name="240117219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117219">(May 24 2021 at 21:52)</a>:</h4>
<p>But when we know we have no NaNs we can do this faster.</p>



<a name="240117255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117255">(May 24 2021 at 21:53)</a>:</h4>
<p>x86 min/max instructions always return their second(?) arg if either input is a NaN, which doesn't match any of ieee 754's 3 different min/max definitions</p>



<a name="240117289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117289">(May 24 2021 at 21:53)</a>:</h4>
<p>Codegen is only in scope insofar as it matters to our library's implementation working at all, honestly. ^^;</p>



<a name="240117372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117372">(May 24 2021 at 21:54)</a>:</h4>
<p>the aggro scalarization just was literally bad enough to be worth fixing since we wanted, ideally, to impl this library as part of <code>core</code>, not <code>std</code></p>



<a name="240117398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117398">(May 24 2021 at 21:54)</a>:</h4>
<p>but libm is a <code>std</code> thing.</p>



<a name="240117404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117404">(May 24 2021 at 21:54)</a>:</h4>
<p>I think the motivation of this strange NaN behaviour is to allow a min/max reduction with the first values as a NaN.</p>



<a name="240117405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117405">(May 24 2021 at 21:54)</a>:</h4>
<p>( it's complicated. )</p>



<a name="240117431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117431">(May 24 2021 at 21:54)</a>:</h4>
<p>re: the PR 120, uh...</p>



<a name="240117454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117454">(May 24 2021 at 21:54)</a>:</h4>
<p>I'd expect if you told llvm it doesn't need to care about signed zeros or nans then it'll use one instruction, but those are fastmath flags -- mostly out of scope for core::simd</p>



<a name="240117668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117668">(May 24 2021 at 21:56)</a>:</h4>
<p>Alright.</p>



<a name="240117684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117684">(May 24 2021 at 21:56)</a>:</h4>
<p>Finally. ^^; Trig stuff.</p>



<a name="240117707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117707">(May 24 2021 at 21:57)</a>:</h4>
<p>I'd guess the x86 min/max semantics were chosen for people who wrote C min/max macros like <code>a &lt; b ? a : b</code></p>



<a name="240117717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117717">(May 24 2021 at 21:57)</a>:</h4>
<p>what are you working on exactly? There's been some ongoing discussion.</p>



<a name="240117894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117894">(May 24 2021 at 21:59)</a>:</h4>
<p>I'm working on a computer algebra library using <code>syn</code>. As a byproduct of this, I've generated some candidates for sin and cos using Newtonian polynomials.</p>



<a name="240117917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117917">(May 24 2021 at 21:59)</a>:</h4>
<p><em>actually reviews PR 121</em></p>



<a name="240117934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240117934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240117934">(May 24 2021 at 21:59)</a>:</h4>
<p>Welp! I guess it works. ^^;</p>



<a name="240118199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118199">(May 24 2021 at 22:01)</a>:</h4>
<div class="codehilite"><pre><span></span><code>fn sin(x: f32) -&gt; f32 {
    let x = x * (1.0 / (std::f32::consts::PI * 2.0));
    let x = x - x.floor() - 0.5;
    12.268859941019306_f32
        .mul_add(x * x, -41.216241051002875_f32)
        .mul_add(x * x, 76.58672703334098_f32)
        .mul_add(x * x, -81.59746095374902_f32)
        .mul_add(x * x, 41.34151143437585_f32)
        .mul_add(x * x, -6.283184525811273_f32)
        * x
}
</code></pre></div>



<a name="240118222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118222">(May 24 2021 at 22:01)</a>:</h4>
<p>For example.</p>



<a name="240118246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118246">(May 24 2021 at 22:01)</a>:</h4>
<p>I see.<br>
Well, generally we have been trying to match our scalar implementations, and currently <code>sin</code> and <code>cos</code> on f32 and f64 call to libm, iirc.</p>



<a name="240118286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118286">(May 24 2021 at 22:01)</a>:</h4>
<p>So I suppose we have to raise the question of whether we care about that for these.</p>



<a name="240118360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118360">(May 24 2021 at 22:02)</a>:</h4>
<p>I have working sin_cos_pi functions implemented in vector-math, I've been inspired by <span class="user-mention" data-user-id="412320">@Andy Thomson</span> to switch those to sin(2<em>pi</em>x), that way the multiplication by 0.5 needed for sin_pi and by 1/(2*pi) for sin allows them both to use sin_cos_2_pi as their implementation</p>



<a name="240118610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118610">(May 24 2021 at 22:04)</a>:</h4>
<p>I'm happy for you to do anything you like with the code.</p>



<a name="240118638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118638">(May 24 2021 at 22:04)</a>:</h4>
<p>Andy, you should use roundeven there, it's 1 instruction on most arches and saves the subtraction of 0.5 afterward</p>



<a name="240118646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118646">(May 24 2021 at 22:04)</a>:</h4>
<p>And I know that these functions tend to have varying needs (approximate + fast vs. slow + precise),</p>



<a name="240118658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118658">(May 24 2021 at 22:04)</a>:</h4>
<p>avoiding total loss of precision near zero</p>



<a name="240118672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118672">(May 24 2021 at 22:05)</a>:</h4>
<p>I did think of that. That is a win.</p>



<a name="240118760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118760">(May 24 2021 at 22:05)</a>:</h4>
<p>If you want precise, use f64 and round down to f32. I think this is what libm does. You loose half your performance, though.</p>



<a name="240118844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118844">(May 24 2021 at 22:06)</a>:</h4>
<p>Most importantly, libm does not inline and hence does not autovectorise or get loop scheduling benefits.</p>



<a name="240118865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118865">(May 24 2021 at 22:06)</a>:</h4>
<p>maybe more than half since there's all the lane-crossing conversions</p>



<a name="240118916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118916">(May 24 2021 at 22:07)</a>:</h4>
<p>lane-crossing can be expensive on some architectures</p>



<a name="240118919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118919">(May 24 2021 at 22:07)</a>:</h4>
<p>It is an interesting point as to whether anyone wants the extra 1ulp over the slowdown.</p>



<a name="240118997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240118997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240118997">(May 24 2021 at 22:08)</a>:</h4>
<p>You probably should not be using f32 if you need that extra bit of precision.</p>



<a name="240119006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119006">(May 24 2021 at 22:08)</a>:</h4>
<p>well, the function you gave has waay more than 1ulp error near zero</p>



<a name="240119042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119042">(May 24 2021 at 22:08)</a>:</h4>
<p>But the max error is always &lt; 2^-22</p>



<a name="240119043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119043">(May 24 2021 at 22:08)</a>:</h4>
<p>so "how many ulps of precision do we care about?"</p>



<a name="240119049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119049">(May 24 2021 at 22:08)</a>:</h4>
<p>also near +-pi</p>



<a name="240119115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119115">(May 24 2021 at 22:09)</a>:</h4>
<p>It is impossible to get high relative ULP when the values are very small.</p>



<a name="240119146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119146">(May 24 2021 at 22:09)</a>:</h4>
<p>Again the max error is all anyone cares about.</p>



<a name="240119259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119259">(May 24 2021 at 22:10)</a>:</h4>
<p>the sin_cos_pi function i implemented is +-2ulp across all f32 values (tested all 2^32 values). it gives exact results (other than sign of zero) for all inputs where the ideal result is -1, 0, or 1</p>



<a name="240119280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119280">(May 24 2021 at 22:11)</a>:</h4>
<p>It is important for the abs value to be under 1 at max as people foolishly do acos(sin(x)).</p>



<a name="240119306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119306">(May 24 2021 at 22:11)</a>:</h4>
<p>yup, tested that too--passes</p>



<a name="240119328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119328">(May 24 2021 at 22:11)</a>:</h4>
<p>...wait, what definition of max error differs from ulps of precision? ^^;</p>



<a name="240119331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119331">(May 24 2021 at 22:11)</a>:</h4>
<p>It is in all the games textbooks for finding direction. Much better to use atan2.</p>



<a name="240119414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119414">(May 24 2021 at 22:12)</a>:</h4>
<p>ULP is defined as (a.to_bits() - b.to_bits()).abs()</p>



<a name="240119421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119421">(May 24 2021 at 22:12)</a>:</h4>
<p><span class="user-mention" data-user-id="281757">@Jubilee</span> absolute error</p>



<a name="240119465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119465">(May 24 2021 at 22:13)</a>:</h4>
<p>absolute error is how far on the real number line is it off</p>



<a name="240119498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119498">(May 24 2021 at 22:13)</a>:</h4>
<p>relative error is absolute error / magnitude of correct result</p>



<a name="240119500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119500">(May 24 2021 at 22:13)</a>:</h4>
<p>less than 2^-22 or 0.0000001 ish</p>



<a name="240119530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119530">(May 24 2021 at 22:14)</a>:</h4>
<p>ulps is more-or-less scaled relative error</p>



<a name="240119604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119604">(May 24 2021 at 22:14)</a>:</h4>
<p>Now 10^-30 is different from 10^-20 by a massive margin in ULP terms even though the absolute difference is tiny.</p>



<a name="240119700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119700">(May 24 2021 at 22:15)</a>:</h4>
<p>Mmm.</p>



<a name="240119701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119701">(May 24 2021 at 22:15)</a>:</h4>
<p>well, small numbers are important when calculating sinc</p>



<a name="240119777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119777">(May 24 2021 at 22:16)</a>:</h4>
<p>getting sin(1e-20)=0.00000001 gives a huge error for sinc</p>



<a name="240119833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119833">(May 24 2021 at 22:17)</a>:</h4>
<p>sinc is very common in signal processing (audio and otherwise)</p>



<a name="240119838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119838">(May 24 2021 at 22:17)</a>:</h4>
<p>Sinc is ok, especially if you don't multiply by x in the first place. As the last thing we do is multiply by , then dividing by x should give you the sinc fuction perfectly.</p>



<a name="240119965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119965">(May 24 2021 at 22:18)</a>:</h4>
<p>But to be honest, we should provide sinc as its own function and avoid the very very expensive divide.</p>



<a name="240119986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240119986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240119986">(May 24 2021 at 22:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="412320">Andy Thomson</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Meeting.202021-05-24/near/240117894">said</a>:</p>
<blockquote>
<p>I'm working on a computer algebra library using <code>syn</code>. As a byproduct of this, I've generated some candidates for sin and cos using Newtonian polynomials.</p>
</blockquote>
<p>Oh interesting - is this public? Written in Rust?</p>



<a name="240120012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120012">(May 24 2021 at 22:19)</a>:</h4>
<div class="codehilite"><pre><span></span><code>fn sinc(x: f32) -&gt; f32 {
    let x = x * (1.0 / (std::f32::consts::PI * 2.0));
    let x = x - x.floor() - 0.5;
    12.268859941019306_f32
        .mul_add(x * x, -41.216241051002875_f32)
        .mul_add(x * x, 76.58672703334098_f32)
        .mul_add(x * x, -81.59746095374902_f32)
        .mul_add(x * x, 41.34151143437585_f32)
        .mul_add(x * x, -6.283184525811273_f32)
}
</code></pre></div>



<a name="240120014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120014">(May 24 2021 at 22:19)</a>:</h4>
<p>I've been using maxima</p>



<a name="240120050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120050">(May 24 2021 at 22:19)</a>:</h4>
<p>It is a curious Frankenstein's monster. I do miss Maple, but I can't afford it.</p>



<a name="240120115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120115">(May 24 2021 at 22:20)</a>:</h4>
<p>I wrote a Computer Algebra System in C++ many years ago</p>



<a name="240120158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120158">(May 24 2021 at 22:20)</a>:</h4>
<p>syn makes it a lot easier. I'm too lazy to write a parser :)</p>



<a name="240120243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120243">(May 24 2021 at 22:21)</a>:</h4>
<p>And for codegen for Rust, you can't beat it.</p>



<a name="240120276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120276">(May 24 2021 at 22:21)</a>:</h4>
<p>I wrote it before I knew how to properly parse stuff, so that was always a little wonky</p>



<a name="240120382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120382">(May 24 2021 at 22:22)</a>:</h4>
<p>The plan is to make a procedural macro crate that codegens math functions to order.</p>



<a name="240120507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120507">(May 24 2021 at 22:24)</a>:</h4>
<p>Anyway. We should get on with the agenda.</p>



<a name="240120522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120522">(May 24 2021 at 22:24)</a>:</h4>
<p>what do you do for f64 math fns where f64 is not enough precision?</p>



<a name="240120588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120588">(May 24 2021 at 22:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="412320">Andy Thomson</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Meeting.202021-05-24/near/240118199">said</a>:</p>
<blockquote>
<p><div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">sin</span><span class="p">(</span><span class="n">x</span>: <span class="kt">f32</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kt">f32</span> <span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="p">(</span><span class="mf">1.0</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="p">(</span><span class="n">std</span>::<span class="kt">f32</span>::<span class="n">consts</span>::<span class="n">PI</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="mf">2.0</span><span class="p">));</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">x</span><span class="p">.</span><span class="n">floor</span><span class="p">()</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mf">0.5</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="mf">12.268859941019306_</span><span class="k">f32</span><span class="w"></span>
<span class="w">        </span><span class="p">.</span><span class="n">mul_add</span><span class="p">(</span><span class="n">x</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mf">41.216241051002875_</span><span class="k">f32</span><span class="p">)</span><span class="w"></span>
<span class="w">        </span><span class="p">.</span><span class="n">mul_add</span><span class="p">(</span><span class="n">x</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="mf">76.58672703334098_</span><span class="k">f32</span><span class="p">)</span><span class="w"></span>
<span class="w">        </span><span class="p">.</span><span class="n">mul_add</span><span class="p">(</span><span class="n">x</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mf">81.59746095374902_</span><span class="k">f32</span><span class="p">)</span><span class="w"></span>
<span class="w">        </span><span class="p">.</span><span class="n">mul_add</span><span class="p">(</span><span class="n">x</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="mf">41.34151143437585_</span><span class="k">f32</span><span class="p">)</span><span class="w"></span>
<span class="w">        </span><span class="p">.</span><span class="n">mul_add</span><span class="p">(</span><span class="n">x</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mf">6.283184525811273_</span><span class="k">f32</span><span class="p">)</span><span class="w"></span>
<span class="w">        </span><span class="o">*</span><span class="w"> </span><span class="n">x</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div><br>
</p>
</blockquote>
<p>hmm, mb dumb question but why <code>x * x</code> here?</p>



<a name="240120591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120591">(May 24 2021 at 22:25)</a>:</h4>
<div class="codehilite"><pre><span></span><code>fn gen_sin() -&gt; proc_macro2::TokenStream {
    let xmin = -0.5;
    let xmax = 0.5;

    let approx = expr!((x * 3.1415926535897932384626433 * 2.0).sin() * -1.0)
        .approx(14, xmin, xmax, name!(x), Parity::Odd)
        .unwrap()
        .use_suffix(Some(&quot;f32&quot;.to_string()))
        .unwrap()
        .into_inner();

    quote!(
        fn sin(x: f32) -&gt; f32 {
            let x = x * (1.0 / (std::f32::consts::PI * 2.0));
            let x = x - x.floor() - 0.5;
            #approx
        }
    )
}
</code></pre></div>



<a name="240120730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120730">(May 24 2021 at 22:26)</a>:</h4>
<p>The x * x is a common subexpression. The compiler trivially aggregates them.</p>



<a name="240120753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120753">(May 24 2021 at 22:26)</a>:</h4>
<p>simd_fsqrt: I'm working on a fall-back implementation in vector-math. I'm trying to make it have correct rounding since most cpus have native correctly-rounded sqrt instructions</p>



<a name="240120767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120767">(May 24 2021 at 22:27)</a>:</h4>
<p>The sin function is odd, so most of the terms are in x^2</p>



<a name="240120918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120918">(May 24 2021 at 22:28)</a>:</h4>
<p>I haven't measured <code>vsqrtps</code>. The newton-raphson steps converge very rapidly.</p>



<a name="240120937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120937">(May 24 2021 at 22:28)</a>:</h4>
<p>in debug mode it actually does the mul every time. ^^;</p>



<a name="240120999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240120999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240120999">(May 24 2021 at 22:29)</a>:</h4>
<p>newton's method is slow due to all the divisions, I'm using a different method</p>



<a name="240121014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121014">(May 24 2021 at 22:29)</a>:</h4>
<p><a href="/user_uploads/4715/XKDBCtIoqp6UqzGlJuFIwQHB/Screenshot_20210524-152823.png">Screenshot_20210524-152823.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/XKDBCtIoqp6UqzGlJuFIwQHB/Screenshot_20210524-152823.png" title="Screenshot_20210524-152823.png"><img src="/user_uploads/4715/XKDBCtIoqp6UqzGlJuFIwQHB/Screenshot_20210524-152823.png"></a></div>



<a name="240121027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121027">(May 24 2021 at 22:29)</a>:</h4>
<p>Being a game dev, I don't tend to look to hard at Debug mode :)</p>



<a name="240121184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121184">(May 24 2021 at 22:31)</a>:</h4>
<p>Reciprocal sqrt is very fast. There is also a method where you calculate sqrt(x) and 1/sqrt(x) together.</p>



<a name="240121222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121222">(May 24 2021 at 22:31)</a>:</h4>
<p>yeah, the combined sqrt/rsqrt method is what I'm using</p>



<a name="240121276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121276">(May 24 2021 at 22:32)</a>:</h4>
<p>goldschmidt's method iirc</p>



<a name="240121304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121304">(May 24 2021 at 22:32)</a>:</h4>
<p>That's the one :) I'm terrible with names.</p>



<a name="240121320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121320">(May 24 2021 at 22:32)</a>:</h4>
<p>yeah took me 2 min to remember</p>



<a name="240121325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121325">(May 24 2021 at 22:32)</a>:</h4>
<p>Well, one of the considerations here is we do care about test performance.</p>



<a name="240121370"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121370" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121370">(May 24 2021 at 22:33)</a>:</h4>
<p>Easy to factor out the CSE into a variable.</p>



<a name="240121412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121412">(May 24 2021 at 22:33)</a>:</h4>
<p><code>#[inline(always)]</code></p>



<a name="240121436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121436">(May 24 2021 at 22:33)</a>:</h4>
<p>-C opt-level=3</p>



<a name="240121507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121507">(May 24 2021 at 22:34)</a>:</h4>
<p>opt-level=3 makes debugging a pain</p>



<a name="240121552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121552">(May 24 2021 at 22:34)</a>:</h4>
<p>True. But try running Unreal in Debug mode :)</p>



<a name="240121555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121555">(May 24 2021 at 22:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="229517">Jacob Lifshay</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Meeting.202021-05-24/near/240121412">said</a>:</p>
<blockquote>
<p><code>#[inline(always)]</code></p>
</blockquote>
<p>the inline(always) antipattern is actually exactly why I brought it up. ^^;</p>



<a name="240121648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121648">(May 24 2021 at 22:35)</a>:</h4>
<p>well, if a call/ret combo is more expensive than the function body, i'd say inline it, even in debug mode</p>



<a name="240121718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121718">(May 24 2021 at 22:36)</a>:</h4>
<p>Nearly always, especially with cold code.</p>



<a name="240121721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121721">(May 24 2021 at 22:36)</a>:</h4>
<p>even in opt-level=0 mode</p>



<a name="240121766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121766">(May 24 2021 at 22:36)</a>:</h4>
<p>What is our policy here on #[inline()]?</p>



<a name="240121804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121804">(May 24 2021 at 22:37)</a>:</h4>
<p>figure-it-out-later? :P</p>



<a name="240121818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121818">(May 24 2021 at 22:37)</a>:</h4>
<p>Always the wisest choice.</p>



<a name="240121821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121821">(May 24 2021 at 22:37)</a>:</h4>
<p>Generally we've been annotating everything with #[inline] but that's only really because of the rustc bugs with SIMD.</p>



<a name="240121830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121830">(May 24 2021 at 22:37)</a>:</h4>
<p>prefer to not use #[inline(always)]</p>



<a name="240121932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121932">(May 24 2021 at 22:38)</a>:</h4>
<p>LLVM (or cranelift) will probably do sensible things.</p>



<a name="240121941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121941">(May 24 2021 at 22:38)</a>:</h4>
<p>for vector-math, I've just been ignoring inline completely for now, planning on splattering inline everywhere at some point</p>



<a name="240121967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121967">(May 24 2021 at 22:38)</a>:</h4>
<p>idk about cranelift, does it have an inlining pass?</p>



<a name="240121968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121968">(May 24 2021 at 22:38)</a>:</h4>
<p><span class="user-mention silent" data-user-id="412320">Andy Thomson</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Meeting.202021-05-24/near/240121932">said</a>:</p>
<blockquote>
<p>LLVM (or cranelift) will probably do sensible things.</p>
</blockquote>
<p>this entire library exists because LLVM does not do sensible things, unfortunately. ^^;</p>



<a name="240121973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121973">(May 24 2021 at 22:39)</a>:</h4>
<p>I'm not sure about cross-crate boundaries. I'm presuming something clever happens with inlining.</p>



<a name="240121982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240121982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240121982">(May 24 2021 at 22:39)</a>:</h4>
<p>Anyways this has run over time by some bit. Thank you for coming! Time to get some answers to things.</p>



<a name="240122002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240122002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240122002">(May 24 2021 at 22:39)</a>:</h4>
<p>It's been great. Sorry to stir things up. Thanks for hosting Jubilee.</p>



<a name="240122028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240122028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240122028">(May 24 2021 at 22:39)</a>:</h4>
<p>:)</p>



<a name="240122082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240122082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240122082">(May 24 2021 at 22:40)</a>:</h4>
<p>#[inline] is needed for stuff to work cross-crate unless there are generics. For simd, because of the calling convention issues, we'd ratehr things get inlined than not, so i think we tend to use #[inline]</p>



<a name="240122106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240122106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240122106">(May 24 2021 at 22:40)</a>:</h4>
<p>but not #[inline(always)]</p>



<a name="240122129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240122129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240122129">(May 24 2021 at 22:40)</a>:</h4>
<p>:)</p>



<a name="240122149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240122149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240122149">(May 24 2021 at 22:40)</a>:</h4>
<p>Thanks, Thom.</p>



<a name="240122199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240122199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240122199">(May 24 2021 at 22:41)</a>:</h4>
<p>I guess we'd better wrap up.</p>



<a name="240122221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240122221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240122221">(May 24 2021 at 22:41)</a>:</h4>
<p>If I missed something, please feel free to add it to here: <a href="https://hackmd.io/tRDC_oOBRCeZrvK7ZMuXNQ?both">https://hackmd.io/tRDC_oOBRCeZrvK7ZMuXNQ?both</a></p>



<a name="240122284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240122284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andy Thomson <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240122284">(May 24 2021 at 22:42)</a>:</h4>
<p>See you all. Time for bed for me.</p>



<a name="240122361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240122361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240122361">(May 24 2021 at 22:43)</a>:</h4>
<p>I have my own appointments. Have a good night!</p>



<a name="240122376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240122376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240122376">(May 24 2021 at 22:43)</a>:</h4>
<p>bye all</p>



<a name="240123244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240123244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240123244">(May 24 2021 at 22:53)</a>:</h4>
<p>Bye!</p>



<a name="240124644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240124644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240124644">(May 24 2021 at 23:09)</a>:</h4>
<p>Forgot to note I will be in the sticks with limited internet for a couple weeks <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span> <span class="user-mention" data-user-id="281757">@Jubilee</span> <span class="user-mention" data-user-id="246783">@Miguel Raz Guzmán Macedo</span> I merged the sqrt PR</p>



<a name="240124678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240124678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240124678">(May 24 2021 at 23:10)</a>:</h4>
<p><span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> woohooooo <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> thanks <span class="user-mention" data-user-id="312331">@Caleb Zulawski</span> ! Enjoy the sticks!</p>



<a name="240125046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240125046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240125046">(May 24 2021 at 23:14)</a>:</h4>
<p>Thanks!</p>



<a name="240125149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240125149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240125149">(May 24 2021 at 23:15)</a>:</h4>
<p>all good, enjoy!</p>



<a name="240130395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240130395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240130395">(May 25 2021 at 00:33)</a>:</h4>
<p><span class="user-mention silent" data-user-id="229517">Jacob Lifshay</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Meeting.202021-05-24/near/240120999">said</a>:</p>
<blockquote>
<p>newton's method is slow due to all the divisions, I'm using a different method</p>
</blockquote>
<p>Out of curiosity, how bad is <em>one</em> division?  I'd be curious how Padé would compare.  Like doing <code>sin</code> as</p>
<div class="codehilite"><pre><span></span><code>551 x^5 - 22260 x^3 + 166320 x
------------------------------
  75 x^4 + 5460 x^2 + 166320)
</code></pre></div>
<p>(Well, probably with the constants pre-divided out, but that's what WA gave me easily.)</p>



<a name="240132633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240132633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240132633">(May 25 2021 at 01:14)</a>:</h4>
<p>well, on Haswell, a SIMD f64 division takes 19-35 cycles and it can run a division every 16-28 cycles, whereas, on the same CPU, a SIMD f64 fma takes 5 cycles and it can run 2 fmas every cycle (so 0.5 cycles per fma). See page 242 of <a href="https://www.agner.org/optimize/instruction_tables.pdf">https://www.agner.org/optimize/instruction_tables.pdf</a></p>



<a name="240132718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240132718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240132718">(May 25 2021 at 01:16)</a>:</h4>
<p>so, you could evaluate <code>sin</code>'s taylor series to &gt;10 terms in the time it takes to do one division.</p>



<a name="240132735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240132735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240132735">(May 25 2021 at 01:16)</a>:</h4>
<p>by splitting the evaluation into odd/even polynomials and evaluating them in parallel.</p>



<a name="240132761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240132761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240132761">(May 25 2021 at 01:17)</a>:</h4>
<p>and that still leaves plenty of wiggle room.</p>



<a name="240166050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240166050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240166050">(May 25 2021 at 10:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281757">Jubilee</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Meeting.202021-05-24/near/240116611">said</a>:</p>
<blockquote>
<p>I think someone just needs to sit down and harass bjorn3 a lot.<br>
I've already poked around at Cranelift so maybe I should do it? ^^;</p>
</blockquote>
<p>No need to harass me :) I opened <a href="https://github.com/bjorn3/rustc_codegen_cranelift/issues/1175">bjorn3/rustc_codegen_cranelift#1175</a></p>



<a name="240166229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240166229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240166229">(May 25 2021 at 10:11)</a>:</h4>
<p><span class="user-mention silent" data-user-id="229517">Jacob Lifshay</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Meeting.202021-05-24/near/240117037">said</a>:</p>
<blockquote>
<p>do note that cranelift is currently transitioning from their old x86 backend to their new backend</p>
</blockquote>
<p>cg_clif already switched a while ago. Wasmtime has switched too. I expect the old backend to be removed completely soonish.</p>



<a name="240166794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240166794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240166794">(May 25 2021 at 10:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="229517">Jacob Lifshay</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Meeting.202021-05-24/near/240121967">said</a>:</p>
<blockquote>
<p>idk about cranelift, does it have an inlining pass?</p>
</blockquote>
<p>No, it compiles a single function at a time all the way down to machine code.</p>



<a name="240224478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240224478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240224478">(May 25 2021 at 17:44)</a>:</h4>
<p><span class="user-mention silent" data-user-id="229517">Jacob Lifshay</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Meeting.202021-05-24/near/240121967">said</a>:</p>
<blockquote>
<p>idk about cranelift, does it have an inlining pass?</p>
</blockquote>
<p>MIR has an inliner (albeit I don't think it's on-by-default right now) so we don't have to rely on the codegen backend.</p>



<a name="240230229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240230229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240230229">(May 25 2021 at 18:27)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Meeting.202021-05-24/near/240166050">said</a>:</p>
<blockquote>
<p>No need to harass me :) I opened <a href="https://github.com/bjorn3/rustc_codegen_cranelift/issues/1175">bjorn3/rustc_codegen_cranelift#1175</a></p>
</blockquote>
<p>Thank you!</p>



<a name="240232098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Meeting%202021-05-24/near/240232098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Meeting.202021-05-24.html#240232098">(May 25 2021 at 18:41)</a>:</h4>
<p><span class="user-mention" data-user-id="125270">@scottmcm</span> The MIR inliner is disabled by default. I do have it on for sysroot builds in cg_clif though, but not user builds.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>